package com.hnevc.zhangxiaoyu;


import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import androidx.annotation.Nullable;

/**
 * {服务Service}
 * 生命周期
 */

public class MyService  extends Service {
    @Nullable
    public  void onCreate(){
        super.onCreate();
        Log.i("MyService","创建服务，执行onCreate方法");

    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i("MyService","开启服务，执行onStartCommand");
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i("MyService","关闭服务，执行onDestroy方法");
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}
